package com.ls.thread.timer;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Timer extends Thread {
	
	private SimpleDateFormat sdf=null;
	
	public Timer(){
		sdf=new SimpleDateFormat("HH:mm:ss");
	}
	
	@Override
	public void run() {
		while(true){
			Date tim=new Date();
			System.out.println(sdf.format(tim));
			
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
		
	}
	
	
	public static void main(String[] args) {
		
		Timer t=new Timer();
		t.start();
	}

}
